package handin02;

/** 
 * StringManipulatorTester test the StringManipulator
 * 
 * @author Peter Tolstrup Aagesen
 * 
 * handin #2
 */

public class StringManipulatorTester {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//Create String for testing
		String testStringForCamelCasedResult = "";
		String testStringForCamelCasing01a = "Your";
		String testStringForCamelCasing01b = "BASES";		
		String testStringForCamelCasing02a = "aRE";
		String testStringForCamelCasing02b = "beLOng";		
		String testStringForCamelCasing03a = "TO";
		String testStringForCamelCasing03b = "us";
		
		String testStringForOddOrEvenLength01 = "Some long and even lengthed string";
		String testStringForOddOrEvenLength02 = "Odd lengthed.";
		
		String testStringForInitialFromName01a = "John";
		String testStringForInitialFromName01b = "Doe";
		String testStringForInitialFromName02a = "MASTER";
		String testStringForInitialFromName02b = "chief";
		
		/*Test toCamelCase*/
		System.out.println("--Test toCamelCase method--");
		System.out.println("First test on 'Your' and 'BASES'");
		System.out.println("Expected: youBases");
		System.out.print("Result: ");
		testStringForCamelCasedResult = StringManipulator.toCamelCase(testStringForCamelCasing01a, testStringForCamelCasing01b);
		System.out.println(testStringForCamelCasedResult);
		System.out.println();
		System.out.println("Second test on 'aRE' and 'beLOng'");
		System.out.println("Expected: areBelong");
		System.out.print("Result: ");
		testStringForCamelCasedResult = StringManipulator.toCamelCase(testStringForCamelCasing02a, testStringForCamelCasing02b);
		System.out.println(testStringForCamelCasedResult);
		System.out.println();
		System.out.println("Third test on 'TO' and 'us'");
		System.out.println("Expected: toUs");
		System.out.print("Result: ");
		testStringForCamelCasedResult = StringManipulator.toCamelCase(testStringForCamelCasing03a, testStringForCamelCasing03b);
		System.out.println(testStringForCamelCasedResult);
		System.out.println();
		
		/*Test oddOrEventLength*/
		System.out.println("--Test oddOrEventLength method--");
		System.out.println("Test even lengthed word:");
		System.out.println("Expected: 0");
		System.out.print("Result: ");
		System.out.println(StringManipulator.oddOrEventLength(testStringForOddOrEvenLength01));
		System.out.println();
		System.out.println("Test odd lengthed word:");
		System.out.println("Expected: 1");
		System.out.print("Result: ");
		System.out.println(StringManipulator.oddOrEventLength(testStringForOddOrEvenLength02));
		System.out.println();
		
		//Test oddOrEventLength
		System.out.println("--Test initialsFromName method--");
		System.out.println("First test on 'John' and 'Doe':");
		System.out.println("Expected: J. D.");
		System.out.print("Result: ");
		System.out.println(StringManipulator.initialsFromName(testStringForInitialFromName01a, testStringForInitialFromName01b));
		System.out.println();
		System.out.println("Second test on 'MASTER' and 'chief':");
		System.out.println("Expected: M. C.");
		System.out.print("Result: ");
		System.out.println(StringManipulator.initialsFromName(testStringForInitialFromName02a, testStringForInitialFromName02b));
		System.out.println();
		
		//Test generatUsageRepport
		System.out.println("--Test generateUsageReport method--");
		System.out.println("Expected result: toCamelCase: 3, oddOrEvenLength: 2, initialsFromName: 2");
		StringManipulator.generateUsageReport();

	}

}
